<sqx-title message="i18n:common.templates" />
<sqx-layout innerWidth="50" layout="main" titleIcon="templates" titleText="i18n:common.templates">
    <ng-container menu>
        <button class="btn btn-text-secondary me-2" (click)="reload()" shortcut="CTRL + B" title="i18n:templates.refreshTooltip" type="button">
            <i class="icon-reset"></i> {{ "common.refresh" | sqxTranslate }}
        </button>
    </ng-container>
    <ng-container>
        <sqx-list-view innerWidth="50rem" [isLoading]="templatesState.isLoading | async">
            <sqx-form-alert light="true">
                <div inline="true" [sqxMarkdown]="'templates.cliHint' | sqxTranslate"></div>
            </sqx-form-alert>
            @if ((templatesState.isLoaded | async) && (templatesState.templates | async); as templates) {
                @for (template of templates; track template.name) {
                    <sqx-template [template]="template" />
                }
            }
        </sqx-list-view>
    </ng-container>
    <ng-template sidebarMenu>
        <div class="panel-nav">
            <a
                class="panel-link"
                attr.aria-label="{{ 'common.help' | sqxTranslate }}"
                queryParamsHandling="preserve"
                replaceUrl="true"
                routerLink="help"
                routerLinkActive="active"
                sqxTourStep="help"
                title="i18n:common.help"
                titlePosition="left">
                <i class="icon-help2"></i>
            </a>
        </div>
    </ng-template>
</sqx-layout>
<router-outlet></router-outlet>
